package com.zcb.rxjavapractice;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.text.TextUtils;
import android.util.Xml;
import android.view.MotionEvent;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import com.zcb.rxjavapractice.activity.ImgCacheActivity;
import com.zcb.rxjavapractice.activity.SkipAndComblineLatestActivity;
import com.zcb.rxjavapractice.activity.SplashActivity;

import org.xmlpull.v1.XmlPullParser;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StringReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;

import rx.Observable;
import rx.Subscriber;
import rx.Subscription;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Func1;
import rx.schedulers.Schedulers;

public class MainActivity extends ActionBarActivity implements View.OnClickListener, View.OnTouchListener {
    /**
     * 天气预报API地址
     */

    private Subscription subscription;
    private Button timerOperatorBtn;
    private Button skipOrCombineLatestBtn;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        //获取控件实例
        timerOperatorBtn= (Button) findViewById(R.id.time_operator_btn);
        skipOrCombineLatestBtn= (Button) findViewById(R.id.skip_combineLatest_operator_btn);

        timerOperatorBtn.setOnClickListener(this);
        skipOrCombineLatestBtn.setOnClickListener(this);


    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
        case R.id.time_operator_btn :
            startActivity(new Intent(MainActivity.this, SplashActivity.class));
            break;
        case R.id.skip_combineLatest_operator_btn :

            startActivity(new Intent(MainActivity.this, SkipAndComblineLatestActivity.class));
                break;
//        case R.id.time_operator_btn :
//                openTimerOperator();
//                break;

        }

    }




    @Override
    public boolean onTouch(View view, MotionEvent motionEvent) {
        return false;
    }
}